import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { IAwake } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { IDestroy } from "../../../../../Core/Module/EventSystem/IDestroySystem";
import { IPEndPoint } from "../../../../../Core/System/IPEndPoint";

export enum RouterStatus {
    Sync,
    Msg,
}

export class RouterNode extends Entity implements IDestroy, IAwake {
    public ConnectId: number;
    public InnerAddress: string;
    public InnerIpEndPoint: IPEndPoint;
    public OuterIpEndPoint: IPEndPoint;
    public SyncIpEndPoint: IPEndPoint;
    public OuterConn: number;
    public InnerConn: number;
    public LastRecvOuterTime: number;
    public LastRecvInnerTime: number;

    public RouterSyncCount: number;
    public SyncCount: number;

    //#region 限制外网消息数量，一秒最多50个包

    public LastCheckTime: number;
    public LimitCountPerSecond: number;

    //#endregion

    public Status: RouterStatus;
}